package com.tedu.day05mybatis.mapper;

import com.tedu.day05mybatis.pojo.Weibo;
import com.tedu.day05mybatis.pojo.WeiboVO1;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface WeiboMapper {
    //在resources/mapper/WeiboMapper.xml中定义了该方法，并且为该方法配置了要指定的SQL语句
    int insert(Weibo weibo);

    int deleteById(Integer id);

    int updateById(Weibo weibo);

    Weibo findById(Integer id);

    List<Weibo> findAll();

    Weibo selectContentCreatedById(Integer id);

    WeiboVO1 selectOnlyContentCreatedById(Integer id);
    //动态SQL
    int dynamicUpdate(Weibo weibo);
    /*
    DELETE FROM weibo WHERE id IN(1,2,3,4,5)
     */
    int deleteByIds(Integer[] ids);
}
